import { defineStore } from "pinia"

export const searchStore = defineStore('search', {
    state() {
        return {
            searchList: [],
        }
    },
    actions: {
        saveSearchList(data: any) {
            this.searchList = data
        },
    },
    getters: {
        getSearchList(): any {
            return this.searchList
        },
    },
    persist: {
        enabled: true,
        strategies: [
            {
                key: 'search', //设置存储的key
                storage: localStorage, //表示存储在localStorage
            },
        ],
    },
})